package cn.lg.soar.flow.api.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author luguoxiang
 * @date 2023/6/27
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Getter
@Setter
@Schema(description = "流程信息")
public class FlowInfoDTO {

    /**
     * 流程实例id
     */
    @Schema(description = "流程实例id")
    private String procInstId;

    /**
     * 流程开始时间
     */
    @Schema(description = "流程开始时间")
    private Date startTime;

    /**
     * 流程结束时间
     */
    @Schema(description = "流程结束时间")
    private Date endTime;

    /**
     * 流程是否结束
     */
    @Schema(description = "流程是否结束")
    private boolean ended;

    /**
     * 流程code
     */
    @Schema(description = "流程code")
    private String flowCode;

    /**
     * 流程定义id
     */
    @Schema(description = "流程定义id")
    private String flowId;

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
        this.ended = endTime != null;
    }

}
